<?php

/*
 * This file is create for storing name of table, and field.
 * 
 */

if (!function_exists('table')) {

    function table($key) {
        // Tables' name
        $table['activity'] = 'tbl_activity';
        $table['slideshow'] = 'tbl_slideshow';
		$table['minislideshow'] = 'tbl_mini_slideshow';
        $table['page'] = 'tbl_page';
        $table['product'] = 'tbl_product';
        $table['user'] = 'tbl_user';
		
        if (array_key_exists($key, $table)) {
            return $table[$key];
        } else {
            return NULL;
        }
    }

}

if (!function_exists('field')) {

    function field($key) {
        // Fields' name
        $field['id'] 		= 'id';
        $field['type'] 		= 'type';
		
        $field['brokenRate'] 	= 'broken_rate';
        $field['shipping'] 		= 'shipping';
        $field['miniOrder'] 	= 'mini_order';
        $field['paymentTerm'] 	= 'payment_term';
        $field['fobPrice'] 		= 'fob_price';
        $field['image'] 		= 'image';
				
        $field['title']		= 'title';
        $field['label'] 	= 'label';
        $field['description'] = 'description';
		
        $field['name'] 		= 'name';
        $field['fullName'] 	= 'full_name';
        $field['username'] 	= 'username';
        $field['password'] 	= 'password';
        $field['email'] 	= 'email';

		// Alias Fields
		$field['userFullName']	= 'user_name';


        if (array_key_exists($key, $field)) {
            return $field[$key];
        } else {
            return NULL;
        }
    }

}